<link rel="stylesheet" type="text/css" href="__PUBLIC__/static/client/default/css/base.css"/>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/static/client/default/css/seller_center.css"/>
<script src="__PUBLIC__/static/client/default/js/common.js" type="text/javascript" charset="utf-8"></script>
<script src="__PUBLIC__/static/client/default/js/jquery.validation.min.js" type="text/javascript" charset="utf-8"></script>


<div class="eject_con">
  <div id="warning" class="alert alert-error"></div>
  <form method="post" action="{:url('company/edit_area')}" id="address_form" target="_parent">
    <input type="hidden" value="{$address_info['city_id']}" name="city_id" id="_area_2">
    <input type="hidden" value="{$address_info['area_id']}" name="area_id" id="_area">
    <input type="hidden" name="id" value="{$address_info['id']}" />
    <dl>
      <dt><i class="required">*</i>所在地区：</dt>
      <dd>
        <div>
          <input type="hidden" name="region" id="region" value="{$address_info['area_info']}"/>
        </div>
      </dd>
    </dl>
    <div class="bottom">
      <label class="submit-border"><input type="submit" nctype="address_add_submit" class="submit" value="保存" /></label>
    </div>
  </form>
</div>
<script>
var SITEURL = '<?php echo get_root_url();?>';
$(document).ready(function(){
	$("#region").nc_region();
	$('input[nctype="address_add_submit" ]').click(function(){
		if ($('#address_form').valid()) {
			ajaxpost('address_form', '', '', 'onerror');
		}
	});
    $('#address_form').validate({
        errorLabelContainer: $('#warning'),
        invalidHandler: function(form, validator) {
           var errors = validator.numberOfInvalids();
           if(errors)
           {
               $('#warning').show();
           }
           else
           {
               $('#warning').hide();
           }
        },
        rules : {
            region : {
            	checklast: true
            }
        },
        messages : {
            region : {
                checklast : '<i class="icon-exclamation-sign"></i>请将地区选择完整'
            }
        }
    });
});
</script> 